<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>controlP5 : : ControlGroup</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
document.getElementsByTagName('html')[0].className = 'isjs';

function toggle(dt) 
{ 
  var display, dd=dt; 
  /* get dd */ 
  do{ dd = dd.nextSibling } while(dd.tagName!='DD'); 
  toOpen =!dd.style.display; 
  dd.style.display = toOpen? 'block':'' 
  dt.getElementsByTagName('span')[0].innerHTML 
    = toOpen? '-':'+' ; 
} 
</script>
</head>
<body>
<div id="container">
		<div id="header">
		<a href="./index.htm"><img src="./docuImages/title.jpg" /></a>
		</div>
	<div class="content">
		<h1>ControlGroup</h1>
		<dl><dt class="key">description</dt><dd class="value">ControlGroup extends ControllerGroup, for a list and documentation for
 available methods see the <a
 href="./controllergroup_class_controllergroup.htm">ControllerGroup</a>
 documentation.
 
 use a controlGroup to bundle several controllers. controlGroups can be closed
 and opened to keep the screen organized.</dd></dl>
			
			<div class="toggleList example">
				<dl><dt onclick="toggle(this)"><span>+</span>Example</dt>
					<dd><pre>import controlP5.*;

ControlP5 controlP5;

void setup() {
  size(400,400);
  frameRate(30);

  controlP5 = new ControlP5(this);
  ControlGroup l = controlP5.addGroup("myGroup",100,200);
  controlP5.addBang("A-1",0,4,20,20).setGroup(l);
  controlP5.addBang("A-2",30,4,20,20).setGroup(l);
  l.setBackgroundColor(color(255,100));
  l.setBackgroundHeight(150);
  println("the height of controlgroup l: "+l.getBackgroundHeight());
  
  ControlGroup l2 = controlP5.addGroup("myGroup2",100,40,200);
  l2.activateEvent(true);
  
  
  controlP5.addBang("B-1",0,4,20,20).setGroup(l2);
  Radio r = controlP5.addRadio("radio",100,4);
  r.add("black",0);
  r.add("red",1);
  r.add("green",2);
  r.add("blue",3);
  r.add("grey",4);
  r.setColorLabel(0xffff0000);
  r.setGroup(l2);
  
  
}

void draw() {
  background(0);
}


void controlEvent(ControlEvent theEvent) {
  if(theEvent.isGroup()) {
    println("got an event from group "+theEvent.group().name()+", isOpen? "+theEvent.group().isOpen());  
  } else if (theEvent.isController()){
    println("got something from a controller "+theEvent.controller().name());
  }
}


void keyPressed() {
  if(key==' ') {
    controlP5.group("myGroup").remove();
  }
}
</pre></dd>
				</dl>
			</div>
			
			
			<!-- noConstructor:START
			<dl><dt class="key">constructors</dt><dd class="value"><pre></pre></dd></dl>
			noConstructor:END -->
			
			
			
			
			
			
			<!-- METHODS:BEGIN -->
			
       <dl class="noborder"><dt>Methods</dt></dl>
       <dl><dt class="key"><a href="controlgroup_method_activateevent.htm">activateEvent ( )</a></dt><dd class="value">activate or deactivate the Event status of a tab.</dd></dl>
<dl><dt class="key"><a href="controlgroup_method_addclosebutton.htm">addCloseButton ( )</a></dt><dd class="value">add a close button to the controlbar of this controlGroup.</dd></dl>
<dl><dt class="key"><a href="controlgroup_method_removeclosebutton.htm">removeCloseButton ( )</a></dt><dd class="value">remove the close button.</dd></dl>

   
			<!-- METHODS:END -->
			<div class="separator">
			<dl><dt class="key">usage</dt><dd class="value">Web & Application</dd></dl>
			</div>
			<div class="separator">
			<dl><dt class="key">related</dt><dd class="value"><ul><li><a href="controllergroup_class_controllergroup.htm">ControllerGroup</a></li>
</ul></dd></dl>
			</div>
	</div>
	<div id="footer">
	<p>by andreas schlegel (<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" target="_blank">cc</a>) 2007, <a href="http://www.sojamo.de" target="_blank">sojamo</a>.</p>
	</div>
</div>
</body>
</html>


